import axios from '@/utils/request';

//获取活动列表
export function getActivityList(current: number, size: number) {
    return axios({
        url: `/activity/activity/getActivityList/${current}/${size}`,
        method: "get"
    })
}

//新增活动
export function addActivity(activity: object) {
    return axios({
        url: "/activity/activity/addActivity",
        method: "post",
        data: activity
    })
}

//修改活动
export function updateActivity(activity: object) {
    return axios({
        url: "/activity/activity/updateActivity",
        method: "put",
        data: activity
    })
}

//删除活动
export function deleteActivity(ids: []) {
    return axios({
        url: "/activity/activity/deleteActivity/" + ids,
        method: "delete"
    })
}

//根据id获取活动信息
export function getActivity(id: number) {
    return axios({
        url: "/activity/activity/" + id,
        method: "get"
    })
}

//搜索
export function searchActivity(activityParams: object) {
    return axios({
        url: "/activity/activity/searchActivity",
        method: "post",
        data: activityParams
    })
}

//导出
export function exportActivity() {
    return axios({
        url: "/activity/activity/exportActivity",
        method: "get",
        responseType: 'blob',
    })
}